package com.lwei.tallybook.base.domain.rel;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.lwei.tallybook.base.domain.base.BaseDomain;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 账本实体表与参与者关联表
 * @author sks.lwei
 */
@Getter
@Setter
@TableName("rel_book_participator")
public class RelBookAccount extends BaseDomain<RelBookAccount> {

    /**
     * book-uuid
     */
    @TableField("consume_uuid")
    private String bookUuid;
    @TableField("account_uuid")
    private String accountUuid;
    /**
     * 消费时间
     */
    @TableField("consume_time")
    private Date consumeTime;

    public RelBookAccount(String bookUuid, String accountUuid, Date consumeTime) {
        super.setUuid("rp_"+ IdWorker.getIdStr());
        this.bookUuid = bookUuid;
        this.accountUuid = accountUuid;
        this.consumeTime = consumeTime;
    }
}
